const time = []
const util = require("../../utils/util");
for (let i = 5; i <= 60; i++) {
  time.push(i)
}

Page({
  /**
   * 页面的初始数据
   */
  data: {
    title:"专注",
    isTransform:true,
    isBack:false,
    time: time,
    min: 5,
    height:"",
    logining:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //选择器
    const that = this
    wx.createSelectorQuery().selectAll('.picker-view').boundingClientRect(function (rect) {
      that.setData({
        //获取宽度给高度
        height:rect[0].width
      })
  }).exec()
  },
  bindChange: function (e) {
    const val = e.detail.value
    this.setData({
      min: this.data.time[val]
    })
  },
  toFocus(){
    let min = this.data.min;
    let that = this;
    if (util.isLoged()) {
      wx.navigateTo({
        url:"../beginfocus/beginfocus?time="+min,
      })
    } else {
      that.setData({
        logining: 'show'
      })
    }
  }
})